package com.segersten.othello.service.akka

/*import akka.actor.Actor
import akka.actor.Actor._
import akka.stm._
import akka.stm.TransactionalMap
import scala.xml.NodeSeq
import java.lang.Integer
*/
class SimpleServiceActor /*extends Actor */{
 /* private val KEY = "COUNTER_X"
  private var hasStartedTicking = false
  private val storage = TransactionalMap[String, Integer]()

  def receive = {
    case "Tick" => if (hasStartedTicking) {
      val count = atomic {
        val current = storage.get(KEY).get.asInstanceOf[Integer].intValue
        val updated = current + 1
        storage.put(KEY, new Integer(updated))
        updated
      }
      self.reply(<success>****Tick:{count}</success>)
    } else {
      atomic {
        storage.put(KEY, new Integer(0))
      }
      hasStartedTicking = true
      self.reply(<success>****Tick: 0</success>)
    }
  }
  */
}